<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>广告管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#name").focus();
			$("#validDays").val('${advertisement.validDays}');
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		
		
		/////////////
		function addSeller(){
			
		}
		
		
		
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/sys/role/toWechatBusiness?id=${role.id}">微信服务</a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="role" action="${ctx}/sys/role/save" method="post" class="form-horizontal"  enctype="multipart/form-data" >
		<form:hidden path="id"/>
		<form:hidden path="name"/>
		
		<input id="oldName" name="oldName" type="hidden" value="${role.name}">
		<tags:message content="${message}"/>
		
		<div class="control-group">
			<label class="control-label">服务名称：</label>
			<div class="controls">
				<ol>
				<c:forEach items="${role.businessConfigList }" var="businessConfig">
				  <li>${businessConfig.name }</li>
				</c:forEach>
				</ol>
			</div>
		</div>
		
		<div class="control-group">
			<label class="control-label">微信服务:</label>
			<div class="controls">
				<tags:treeselect id="businessConfigList" name="configIds" value="${role.configIds }" checked="true"  labelName="businessConfigList.name"  labelValue="${role.configNames }"
					title="微信服务列表" url="/sys/role/allUserTreeData"/>
			</div>
		</div>
		
		
		
		<div class="form-actions">
			<shiro:hasPermission name="sys:role:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>
